extends ../layout

block main
	ul.breadcrumb
		li
			i.icon-home
		li
			i.icon-angle-right
		li
			a(href="/") 面板


	div(class="row-fluid sortable")
		div(class="box span12")
			div(class="box-header", data-original-title)
				h2
					i(class="halflings-icon user")
					span.break
					| 订单

			div.box-content		
				table(class="table table-striped table-bordered bootstrap-datatable datatable")
					thead
						tr
							th 时间
							th 用户
							th 拼单号
							th 支付单号
							th 退款单号
							th 金额
							th 数量
							th 节省
							th 状态
					tbody
						- var states = ["待确认", "已确认/待付款/超时未付款", "已付款/待退款", "已退款"]
						- each contractor in contractors
							tr
								td= moment(contractor.updatedAt).format('LLL')
								td
									a(href="/customers/#{contractor.get('customer_id')}", target="_blank") #{contractor.get('customer_id')}
								td= contractor.get('contract_id')
								td
									a(href="/payments/#{contractor.get('payment_id')}", target="_blank") #{contractor.get('payment_id')}
								td
									a(href="/refunds/#{contractor.get('refund_id')}", target="_blank") #{contractor.get('refund_id')}
								td= contractor.get('money')
								td= contractor.get('quantity')
								td= contractor.get('saving')
								td= states[contractor.get('state') - 1]